package MainPackage
{

  /**
   * ...
   * @author ...
   */
  public class GlobalSettings
  {
    private static var instance:GlobalSettings = null;
    private static var isInternalConstructor:Boolean = false;

    [Bindable]
    public var volume:Number;
    public var countries:Array;
    public var profile:Object;

    public function GlobalSettings()
    {
      if (instance || !isInternalConstructor)
      {
        trace("GlobalSettings is a singlton. Use getInstance() instead.");
        throw 1;
      }

      volume = 0.5;
      instance = this;
    }

    static public function getInstance():GlobalSettings
    {
      if (!instance)
      {
        isInternalConstructor = true;
        var ins:GlobalSettings = new GlobalSettings;
        isInternalConstructor = false;
      }

      return instance;
    }
  }

}